<?php
	use yii\helpers\Html;
	use yii\helpers\Url;
	use yii\widgets\ActiveForm;
	use yii\widgets\LinkPager;
?>
<style>
	.status-1 {
		background-color: #999;
	}
	.status-2 {
		background-color: #FFF;
	}
	.status-3 {
		background-color: #FF0;
	}
	.status-4 {
		background-color: #06F;
	}
	.status-5 {
		background-color: #C00;
	}
	.js_fb {
		color: #000;
	}
	.footer-img {
		width: 1024px;
		height: 95px;
		background: url('http://statics.heivr.com/image/546358d8dc6076105b8b466b.png');
	}
</style>
<div class="page-header">
	<h1>
		房源管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			房源信息
		</small>
	</h1>
	<div class="nav-search" style="right:126px;top:10px;" id="nav-search">
		<?php $form = ActiveForm::begin([
			'enableClientValidation' => true,
			'method' => 'get',
			'options' => ['class' => 'form-search'],
		])?>
			<span class="input-icon">
				<select name="floorId" id="J_Change">
					<option value="">请选择楼号</option>
					<?php foreach($floor as $fl):?>
						<option value="<?= $fl['id']?>"><?= $fl['fName']?></option>
					<?php endforeach;?>

				</select>
				<input type="submit" style="padding-right: 22px;margin-left: 20px;background: #438EB9;color: white;border: none;border-radius: 5px;" value="搜索">
			</span>
		<?php ActiveForm::end();?>

	</div>
</div><!-- /.page-header -->

<!-- PAGE CONTENT BEGINS -->
<div class="row">
	<div class="col-xs-12">
		<table id="simple-table" class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th class="center" width="100px">楼层</th>
					<?php if(!empty($unitNo) ): foreach(array_reverse($unitNo) as $val):?>
					<th><?php echo $val;?></th>
					<?php endforeach;endif;?>
				</tr>
			</thead>

			<tbody>
				<tr>
					<td width="100px;">
						<table class="table table-striped table-bordered table-hover" width="100%" height="100%">
							<?php  if(!empty($tier)): foreach($tier as $k => $v):?>
								<tr>
									<th width="100%"><?php echo count($tier)-$k+1?>层</th>
								</tr>
							<?php endforeach;endif;?>
						</table>
					</td>
					<?php if(!empty($rooms) ):foreach(array_reverse($rooms) as $k1 => $v1):?>
					<td height="%">
						<table class="table table-striped table-bordered table-hover" width="100%" height="100%" >
					
							<?php if(!empty($v1)): foreach(array_reverse($v1) as $k2 => $v2):?>
							  <tr>
							 <?php //($v2);exit;?>
								<?php if(!empty($v2)): foreach(array_reverse($v2) as $k3 => $v3):?>
									<td width="" class="status-<?php echo $v3['status'];?>"> 
										<?php if($v3['status'] ==1 ) :?>
											<strong><?php echo $v3['roomId'];?></strong>
										<?php else:?>
										<a href="<?php echo Url::toRoute(['room/detail','floorId'=>$floorId,'id'=>$v3['id']])?>"  class="js_fb" rel="facebox">
											<strong><?php echo $v3['roomId'];?></strong>
										</a>	
										<?php endif;?>
									</td>
								<?php endforeach; endif;?> 
							  </tr>
							<?php endforeach; endif;?> 
						</table>
					</td>
					<?php endforeach;endif;?> 
			
				</tr>
			
			</tbody>
			
		</table>
		<div class="footer-img"></div>

	</div><!-- /.span -->
</div><!-- /.row -->
<script src="./ace/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
	function del(id){
		if(window.confirm('确认要删除么?')){
			window.location.href = "<?php echo Url::toRoute(['content/del'])?>&id="+id;
		}
	}
	$(function(){
		$("#J_Change").bind('change',function(){


			$('form')[0].submit();
		})
	})
</script>
<div class="hr hr-18 dotted hr-double"></div>